package pers.kw.file.api;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import pers.kw.protocol.R;

import javax.servlet.http.HttpServletResponse;

@RequestMapping(value = "/file/api/")
public interface FileApi {

    @PostMapping("upload/single")
    R<String> uploadFile(MultipartFile file) throws Exception;

    @GetMapping("download/single")
    void downloadFile(HttpServletResponse httpServletResponse, @RequestParam(value = "fileName") String fileName) throws Exception;

    @GetMapping("access/url")
    R<String> getFileExpiryAccessUrl(@RequestParam(value = "fileName") String fileName) throws Exception;
}
